Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

108
Visualizações
Android Chrome adds unwanted ".txt" extension to downloaded files with non-conventional extensions (e.g. 3dxml)

In my client side javascript code, there is a blob that I need to download with a specific file extension (.3dxml => 3D design model file). For this, I create a hidden html "a" tag, link the blob url to this tag, and specify the intended filename with extension (e.g. xyz.3dxml). I then simulate a click event on this link. This works fine in windows desktop chrome browser. But in and Android Chrome browser, after downloading this file appears as "xyz.3dxml.txt". This issue does not occur if I use a more standard file extension (e.g. *.stl).

I use the following code. Please let me know if you have any suggestions/advice.

var blob = new Blob([bufferOut]);
var url = window.URL;
var objectURL = url.createObjectURL(blob); 
var doc = window.document;
var saveLink = doc.createElementNS("http://www.w3.org/1999/xhtml", "a");
saveLink.href = objectURL;
saveLink.download = "xyz.3dxml";
saveLink.type = 'application/octet-stream';
var event = doc.createEvent("MouseEvents");
event.initMouseEvent("click", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
saveLink.dispatchEvent(event);
url.revokeObjectURL(objectURL);
about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda